package com.haibara.aioj.judge.codesandbox.factory;

import com.haibara.aioj.judge.codesandbox.CodeSandbox;
import com.haibara.aioj.judge.codesandbox.impl.ExampleCodeSandbox;
import com.haibara.aioj.judge.codesandbox.impl.RemoteCodeSandbox;
import com.haibara.aioj.judge.codesandbox.impl.ThirdPartyCodeSandbox;
import com.haibara.aioj.judge.model.ExecuteCodeRequest;
import com.haibara.aioj.judge.model.ExecuteCodeRespond;

public class CodeSandboxFactory {

    /**
     * 根据类型提供对应的代码沙箱
     * @param type
     * @return
     */
    public CodeSandbox getCodeSandbox(String type) {
        switch (type){
            case "example" : return new ExampleCodeSandbox();
            case "remote" : return new RemoteCodeSandbox();
            case "thirdParty" : return new ThirdPartyCodeSandbox();
            default: return new ExampleCodeSandbox();
        }
    }
}
